<?php

class Retailer_Backend_Block_Adminhtml_Customers_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
{
  protected function _prepareForm()
  {
      $form = new Varien_Data_Form();
      $this->setForm($form);
      $form->setDataObject(Mage::registry('backend_data'));
      $data = Mage::registry('backend_data');
      //$session = Mage::getSingleton('adminhtml/session');
      $fieldset = $form->addFieldset('backend_form', array('legend'=>Mage::helper('backend')->__('Customer information')));
      $this->_setFieldset(array($data->getAttribute('group_id')), $fieldset);
      $fieldset->addField('firstname', 'text', array(
          'label'     => Mage::helper('backend')->__('First Name'), //Mage::getModel('admin/user')->load($session->getId())->getId()
          'class'     => 'required-entry',
          'required'  => false,
          'name'      => 'firstname',
      ));

      $fieldset->addField('lastname', 'text', array(
          'label'     => Mage::helper('backend')->__('Last Name'),
          'required'  => false,
          'name'      => 'lastname',
      ));

      $fieldset->addField('email', 'text', array(
          'label'     => Mage::helper('backend')->__('Email (Used to login and receive news)'),
          'required'  => true,
          'name'      => 'email',
      ));
//
      $fieldset->addField('password', 'password', array(
          'label'     => Mage::helper('backend')->__('Password'),
          'required'  => false,
          'name'      => 'password',
      ));
      $fieldset->addField('set_link', 'checkbox', array(
          'label'     => Mage::helper('backend')->__('Link to Admin?'),
          'required'  => false,
          'name'      => 'set_link',
          'value'     => 'yes',
      ));
//
//      $fieldset->addField('status', 'select', array(
//          'label'     => Mage::helper('backend')->__('Status'),
//          'name'      => 'status',
//          'values'    => array(
//              array(
//                  'value'     => 1,
//                  'label'     => Mage::helper('backend')->__('Enabled'),
//              ),
//
//              array(
//                  'value'     => 2,
//                  'label'     => Mage::helper('backend')->__('Disabled'),
//              ),
//          ),
//      ));
//
//      $fieldset->addField('content', 'editor', array(
//          'name'      => 'content',
//          'label'     => Mage::helper('backend')->__('Content'),
//          'title'     => Mage::helper('backend')->__('Content'),
//          'style'     => 'width:700px; height:500px;',
//          'wysiwyg'   => false,
//          'required'  => false,
//      ));
                
     
      if ( Mage::getSingleton('adminhtml/session')->getBackendData() )
      {
          $form->setValues(Mage::getSingleton('adminhtml/session')->getBackendData());
          Mage::getSingleton('adminhtml/session')->setBackendData(null);
      } elseif ( Mage::registry('backend_data') ) {
          $form->setValues(Mage::registry('backend_data')->getData());
      }
      return parent::_prepareForm(); 
  }
}